package cn.cvs.service.volunteerApply;

import cn.cvs.pojo.VolunteerApply;
import cn.cvs.dao.volunteerApply.VolunteerApplyMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class VolunteerApplyServiceImpl implements VolunteerApplyService {

    @Resource
    private VolunteerApplyMapper volunteerApplyMapper;

    @Override
    public List<VolunteerApply> queryPageList(Integer status, Integer pageIndex, Integer pageSize) {
        int pageBegin = (pageIndex-1)*pageSize;
        return volunteerApplyMapper.list(status,pageBegin,pageSize);
    }

    @Override
    public int count(Integer status) {
        return volunteerApplyMapper.count(status);
    }

    @Override
    public int removeById(Integer id) {
        return volunteerApplyMapper.deleteById(id);
    }

    @Override
    public VolunteerApply queryById(Integer id) {
        return volunteerApplyMapper.selectById(id);
    }

    @Override
    public int modifyById(Integer id, Integer status) {
        return volunteerApplyMapper.updateById(id,status);
    }
}
